// TOWN DIALOGUE SCRIPT
//    Town 151: Dellston

begintalkscript;

variables;

short i,j,k,r1,choice;

// Macitar

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Macitar";
	text1 = "A wizard of the Empire army patrols the town carefully, looking carefully for breaches in the walls.";
	text2 = "He stops so you can speak with him, but doesn't stop watching the walls. _I am Macitar. Empire-authorized wizard._";
	text5 = "Macitar continues his critically-important but horribly boring patrol. He watches the town walls for any signs of weakness or breach. The constant bombardment of thrown boulders constantly undermines their defenses.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_What is your job?_";
	text1 = "_I command the garrison of Dellston. I repair the walls when they get broken._ He turns to you and fixes you with a steely gaze. _And I have little love for Avernites._";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_How have you fared as garrison commander?_";
	text1 = "_I've sworn to defend this city or die trying. It's a draining task, especially since it keeps me from my first love, teaching._";
	text3 = "_I've sworn to defend this city or die trying. Happily, since the giant attacks have mostly stopped, I can soon return to my first love, teaching._";
	action = DEP_ON_SDF 307 8 0;

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_How do you repair the walls?_";
	text1 = "_I will use force barriers, the fastest and easiest way to repair the breaches the giants' boulders make in our walls. All of the breaks are currently repaired, but one boulder can change that._";

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_Why do you dislike Avernites?_";
	text1 = "_Avernites slew Garzahd, the greatest Empire mage for a century, perhaps in history. He was a dark man and little loved, but he was the greatest of our number, and such crimes are seldom forgiven._";

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_What do you teach?_";
	text1 = "He thinks, grimly. _I have little love for Avernites, but much love for teaching magic. Also, I know you fight the same foes as us. You may purchase a few of my spells, if you wish._";
	code =
		sf(151,17,1);
	break;
	
begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(151,17) > 0;
	question = "_We'd like to purchase some of your spells._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Macitar's Spells","Macitar is torn between dislike of your people and a belief that you can help Valorim. He resolves this internal conflict by charging high prices.",97,6,3);
	break;

begintalknode;
	state = 1;
	nextstate = 5;
	question = "_I am looking for employment._";
	text1 = "_You are? Well, there is a massive fortress of giants not far to the south. Raiding their castle should provide all the employment you could possibly want._";
	text3 = "_The giants have stopped attacking. There is little to do here right now, save repair work. And I doubt you have the stomach for that._";
	action = DEP_ON_SDF 307 8 0;

begintalknode;
	state = 5;
	nextstate = -1;
	question = "_Can I get any bounties?_";
	text1 = "_I will never hire an Avernite._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = 1;
	question = "_I'll be moving on._";
	text1 = "_Watch out for falling rocks._";
	action = END_TALK;

// Durning

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 29;
	question = "Durning";
	text1 = "A small, nimble warrior moves smoothly through Dellston, alert for giants to fight. He turns to look at you, and you see his eyes. He looks deranged, at best.";
	text2 = "_I am Durning!_ he shouts, and slaps his chest with his hand. He wears no armor.";
	text5 = "Durning continues to hunt for giants. You would think that he would wear armor. Come to think of it, you'd think he'd also have a weapon. He currently has neither.";
	action = INTRO;

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_How's it going?_";
	text1 = "_Good!_ he shouts lustily. _I fight giants!_";

begintalknode;
	state = 30;
	nextstate = 31;
	question = "_That's all you do?_";
	text1 = "_Yes!_ he says brightly. _I am a mighty warrior of the Heaven and Earth Association!_";

begintalknode;
	state = 31;
	nextstate = 32;
	question = "_What is the Heaven and Earth Association?_";
	text1 = "_I have mighty kung-fu! I know Flying Fist and Shadow Kick style!_";

begintalknode;
	state = 32;
	nextstate = -1;
	question = "_Well, that sounds very impressive._";
	text1 = "_What's more, I can jump straight up twenty feet, with mighty swooshing noise, if necessary. I fight with great honor, doing all my own stunts! My kung-fu is greatest of all!_";

begintalknode;
	state = 29;
	nextstate = 33;
	question = "_You aren't very well-armed._";
	text1 = "_I am armed with Mighty Fist. I can fight on ground, or on roof, or on thin branch high up in tall, attractive tree._";

begintalknode;
	state = 33;
	nextstate = -1;
	question = "_Are there others like you?_";
	text1 = "_I hear rumors of others, a mighty monastery of fighting monks and such, in the islands far to the south. One day, I will seek them and we may trade styles._";

// Rita

begintalknode;
	tag = 80;
	state = -1;
	nextstate = 57;
	question = "Rita";
	text1 = "The inn is kept by a pleasant, matronly woman of advancing years. The battle-axe strapped across her back looks out of place, but she seems comfortable with it. She grins warmly.";
	text2 = "_Call me Rita, ducks. Get comfortable. We have rooms, and we have coffee. Real coffee!_";
	text5 = "Rita works hard at the many tiny jobs involved in running an inn. Occasionally, her battle-axe gets stuck on a chair or knocks over a mug. She isn't used to carrying a weapon.";
	action = INTRO;

begintalknode;
	state = 57;
	nextstate = 58;
	question = "_Is this your place?_";
	text1 = "_Yes, love. I run the inn. Soldiers and refugees need a safe place to stay and warm meals, after all._";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_Do you get many refugees?_";
	text1 = "She shakes her head. _Poor lambs. What can you give them, besides a kind word and a safe place to rest?_";

begintalknode;
	state = 58;
	nextstate = 59;
	question = "_Speaking of safe places to stay, do you have any free rooms?_";
	text1 = "She looks embarrassed. _Mercy me, where are my manners? You don't want to jaw, you want to rest! We have a clean room for only five coins. No alcohol left, but we do have good coffee. Rare, but precious. Only fifty coins._";

begintalknode;
	state = 57;
	nextstate = -1;
	condition = coins_amount() >= 5;
	question = "_I'll take a room._ Pay 5 coins.";
	text1 = "She shows you to your room, chatting happily all the way. She accidentally hits you with the handle of her battle-axe, but you don't take it personally.";
	action = END_TALK;	
	code =
		revive_party();
		change_coins(-5);
		relocate_char(get_pc_id(0),43,35,FALSE);
		relocate_char(get_pc_id(1),44,35,FALSE);
		relocate_char(get_pc_id(2),44,36,FALSE);
		relocate_char(get_pc_id(3),44,35,FALSE);
	break;
	
begintalknode;
	state = 57;
	nextstate = -1;
	question = "_Some coffee, please._ Pay 50 coins.";
	condition = coins_amount() >= 50;
	text1 = "_Here you are, lambs._ The coffee is black, acrid, bitter, and leaves a thick residue on the inside of your mouth. It's perfect.";
	text2 = "She looks behind the counter. _Oops. Sorry dear. Out of coffee._";
	code =
		if (gf(151,18) < 3) {
			change_coins(-50);
			force_char_status(30000,11,5);
			inc_flag(151,18,1);
			rs(2);
			}
			else rs(1);
	break;
	
begintalknode;
	state = 57;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_Then look after yourself, sweetie._";
	action = END_TALK;
